1. Field of the Invention
Embodiments of the present invention relate generally to computer graphics and more specifically to multi-pass spherical cube map blurring.
2. Description of the Related Art
Cube maps are useful for a variety of effects in computer graphics. For example, cube maps may serve as source data for well-known reflection and lighting effects within rendered computer graphics scenes. Cube maps generally include six texture map surfaces, one for each cube face, that represent some environmental detail, such as illuminated color. The cube map is commonly centered about a three-dimensional Cartesian origin, with each cube face intersected through its center by one of the coordinate axes. Data from the cube map is accessed using a direction vector emanating from the origin. With the cube map completely enclosing the origin, any direction vector intersects some portion of the cube map. Data from the cube faces may be sampled using a variety of well-known techniques such as point sampling or bilinear sampling.
One particularly useful application of the cube map is in applying environmentally realistic lighting to one or more objects in a rendered computer graphics scene. For example, an object in a rendered computer graphics scene with a diffuse white light environment generally would be illuminated with diffuse white light. Furthermore, if a colored light source is in close proximity to the rendered object, then the rendered object should also be directionally illuminated from the colored light source. A graphics scene may contain a complex combination of such light sources. To produce realistic and visually pleasing lighting effects in these types of scenes, a technique referred to as “cube map lighting” may be used that employs a cube map of source data that embodies the realistic lighting environment surrounding the object being rendered. The lighting information embodied in the cube map is then used to impart realistic environmental lighting effects on the object being rendered, giving the object a realistic look and feel within the context of the scene.
One common technique for generating a cube map suitable for cube map lighting uses a convolution function referred to as a “cosine weighted average of incoming radiance over a hemisphere.” The convolution function attempts to emulate the actual physical process of generalized illumination and therefore gathers a very large number of samples when computing each resulting sample value in the final cube map. The light radiance gathered by the convolution operation includes, for example, indirect light emitted from directly-lit objects in the scene as well as explicit light sources in the scene. One drawback of such a process is that it can take anywhere from seconds to minutes, a time scale unsuitable for real-time rendering. Cube maps are therefore typically pre-calculated prior to when a graphics application begins operation and uses the cube maps to light one or more objects in a particular rendered scene. Consequently, a second, related drawback is that applications employing real-time rendering are then limited to static cube maps in applying cube map lighting techniques. Thus, applications typically have to restrict their use of certain environmental lighting changes and light emitting object movements because such lighting changes may invalidate the pre-calculated cube maps being used. In addition, secondary lighting effects, such as reflected light, cannot be applied to rendered objects moving within a scene using pre-calculated cube maps, further limiting overall image quality.
As the foregoing illustrates, what is needed in the art is a way to improve the efficiency and flexibility of cube map rendering techniques.